import React, {useEffect, useState} from 'react';
import {List, Modal} from 'antd-mobile';
import Txt from "../../../components/txt/Txt";
import Btn from "../../../components/btn/Btn";
import http from "../../../model/http";
import UserMsg from "../userMsg/UserMsg";
const Item = List.Item;


function Yuyue() {
  const query = http.useQuery(),
      hosId = query.get('hosId');
  const [data,setData] = useState({});

  useEffect(()=>{
    (async ()=>{
      const outUser = await http.outPost('/customer/customerDetail',{
        hosId:hosId,customerCrmId:query.get('crmId'),managerId:query.get('managerId')
      });
      const yuyue = await http.outPost('/customer/getConsultDetail',{
        hosId:hosId,yuyueid:query.get('orderId')
      })
      setData({...outUser.baseInfo[0],...yuyue})
    })()
    // eslint-disable-next-line
  },[])

  return (
    <div className='v-yuyue-notice'>
      <UserMsg hosId={hosId}
               title={(<div className='g-ta-c g-mt30'>
                 <Txt>预约到院咨询时间</Txt>
                 <p className='g-mt10' style={{fontSize:'28px'}}>{data.daoyuan_date}</p>
                 <p className='g-mb10 g-mb10' style={{fontSize:'28px'}}>{data.daoyuan_time}</p>
               </div>)}
               push={(<Item extra={data.trnames}>咨询项目</Item>)}
               msg={data}/>
      <Txt className='g-mt10 g-mb30'>注：停车券已发送至您的账户，请核对出行车辆信息。</Txt>
      {/* <Btn type='primary' onClick={()=>{Modal.alert('确认预约信息','')}} >确定</Btn> */}
    </div>
  )
}

export default Yuyue;